<?php

namespace website\controllers;

use yii\helpers\ArrayHelper;
use common\helpers\Pager;
use common\models\Article;
use common\models\Category;

class ArticleController extends Controller {
    
    
    /**
     * 文章浏览
     * @return mixed
     */
    public function actionDetail()
    {
        if( ! $article = Article::canEdit($this->request->get('id'))) {
            return $this->error('请求异常，请稍后刷新页面重试', 'welcome/index');
        }
        // 参数异常，渲染错误页面
        return $this->render('detail', [
            'article' => $article,
        ]);
    }
}
